<?php
include_once BONE_ROOT.DS.APP_DIR.DS.'templates'.DS.'config'.DS.'config.php';

class template_config_mail extends template_config
{

	protected function center()
	{
		$this->toolbar();
		
		$config = $this->get('config');
		?>

<div class="box">
	<div class="box-tl"><div class="box-tr"><div class="box-tm"></div></div></div>	
	<div class="box-m">
		<h3 class="title"><?php echo $this->get_title(); ?></h3>
		<form action="./" method="post">
		<table class="edit-table">
		<tbody>
		<tr>
		<td class="key">发信邮件</td>
		<td><input type="text" name="from_mail" size="50" value="<?php echo $config->from_mail; ?>" /></td>
		</tr>
		<tr>
		<td class="key">发信人</td>
		<td><input type="text" name="from_name" size="50" value="<?php echo $config->from_name; ?>" /></td>
		</tr>
		<tr>
		<td class="key">发送邮件服务器</td>
		<td>
			<label><input type="radio" name="smtp" value="0" <?php echo $config->smtp?'':'checked'; ?> onclick="javascript:$('#smtp').slideUp();">系统自带</label> &nbsp; 
			<label><input type="radio" name="smtp" value="1" <?php echo $config->smtp?'checked':''; ?> onclick="javascript:$('#smtp').slideDown();">SMTP</label>
		</td>
		</tr>
		</tbody>
		</table>
		
		<div id="smtp" style="display:<?php echo $config->smtp?'block':'none';?>">
		<table class="edit-table">
		<tbody>
		<tr>
		<td class="key">SMTP服务器</td>
		<td><input type="text" name="smtp_host" size="30" value="<?php echo $config->smtp_host; ?>" /> (如 smtp.163.com)</td>
		</tr>
		<tr>
		<td class="key">SMTP端口</td>
		<td><input type="text" name="smtp_port" size="10" value="<?php echo $config->smtp_port; ?>" /> (默认端口是 25)</td>
		</tr>
		<tr>
		<td class="key">SMTP用户名</td>
		<td><input type="text" name="smtp_user" size="20" value="<?php echo $config->smtp_user; ?>" /> (邮箱用户名)</td>
		</tr>
		<tr>
		<td class="key">SMTP密码</td>
		<td><input type="text" name="smtp_pass" size="20" value="<?php echo $config->smtp_pass; ?>" /> (邮箱密码)</td>
		</tr>
		</tbody>
		</table>
		</div>
		
		<table class="edit-table">
		<tbody>
		<tr>
		<td class="key"></td>
		<td>
		<input class="btn" type="submit" value="保存" /> &nbsp; <input class="btn" type="button" value="测试" onclick="javascript:window.location.href='./?controller=config&task=config_mail_test';" />
		</td>
		</tr>
		</tbody>
		</table>
		<input type="hidden" name="controller" value="config" />
		<input type="hidden" name="task" value="config_mail_save" />
		</form>
		
	</div>
	<div class="box-bl"><div class="box-br"><div class="box-bm"></div></div></div>
</div>
		

		<?php
		
	}	

}
?>